<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
 <title>新增信息</title>
    <header th:replace="header::html"></header>
</head>
<body>
    <div class="x-body">
         <form class="layui-form">
             <input id='hiddenId' type='hidden' th:value='${sysDict.id}' name='id' />		<div class='layui-form-item'>
		<div class='layui-form-item'>
				<label  for='dictKey'  class='layui-form-label'><span class='x-red'>*</span>dictKey</label>
				<div class='layui-input-inline'>
					<input th:value='${sysDict.dictKey}' class='layui-input' placeholder='dictKey' type='text' name='dictKey' id='dictKey'  lay-verify='required'>
				</div>
			</div>
		<div class='layui-form-item'>
		<div class='layui-form-item'>
				<label  for='dictValue'  class='layui-form-label'><span class='x-red'>*</span>dictValue</label>
				<div class='layui-input-inline'>
					<input th:value='${sysDict.dictValue}' class='layui-input' placeholder='dictValue' type='text' name='dictValue' id='dictValue'  lay-verify='required'>
				</div>
			</div>
		<div class='layui-form-item'>
		<div class='layui-form-item'>
				<label  for='dictType'  class='layui-form-label'><span class='x-red'>*</span>dictType</label>
				<div class='layui-input-inline'>
					<input th:value='${sysDict.dictType}' class='layui-input' placeholder='dictType' type='text' name='dictType' id='dictType'  lay-verify='required'>
				</div>
			</div>
		<div class='layui-form-item'>
		<div class='layui-form-item'>
				<label  for='remark'  class='layui-form-label'><span class='x-red'>*</span>remark</label>
				<div class='layui-input-inline'>
					<input th:value='${sysDict.remark}' class='layui-input' placeholder='remark' type='text' name='remark' id='remark'  lay-verify='required'>
				</div>
			</div>
		<div class='layui-form-item'>
		<div class='layui-form-item'>
				<label  for='status'  class='layui-form-label'><span class='x-red'>*</span>status</label>
				<div class='layui-input-inline'>
					<input th:value='${sysDict.status}' class='layui-input' placeholder='status' type='text' name='status' id='status'  lay-verify='required'>
				</div>
			</div>

            <div class="layui-form-item">
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  保存
              </button>
            </div>
        </form>
    </div>
	<script type="text/javascript">
		layui.use(['form','layer'], function(){
                $ = layui.jquery;
                var form = layui.form
                ,layer = layui.layer
            //监听提交
            form.on('submit(add)', function(data){
                $.ajax({
                    url:"/sysDicts/add",
                    type:"POST",
                    data:data.field,
                    dataType:'json',
                    success:function(result){
                        if(result.code == 500 || result.code == 5000100 || result.code == 5000101 || result.code == 5000102){
                            layer.alert(result.msg);
                        }else{
                            layer.alert("设置成功", {icon: 6},function () {
                                x_admin_close();
                                x_admin_father_reload();
                            });
                        }
                    }
                });
                return false;
             });
          });
	</script>
</body>
</html>
